package com.tiancheng.trade.authserver.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;

import java.util.Objects;

@TableName("auth_permission")
@Getter
@Setter
public class AuthPermission extends BaseDataPermissionModel {
    private String name;
    private String code;
    private String describe;
    private Long applicationId;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof AuthPermission)) {
            return false;
        }
        AuthPermission that = (AuthPermission) o;
        if (that.getId().equals(this.getId())) {
            return true;
        } else {
            return Objects.equals(this.getCode(), that.getCode()) &&
                    Objects.equals(this.getApplicationId(), that.getApplicationId());
        }
    }

    @Override
    public int hashCode() {
        return Objects.hash(this.getCode(), this.getApplicationId());
    }
}
